package com.google.android.material.appbar;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior;
import o.ard;

class ViewOffsetBehavior<V extends View> extends Behavior<V> {
    private ard ˋ;
    private int ˎ = 0;
    private int ॱ = 0;

    public ViewOffsetBehavior(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public boolean ˎ(CoordinatorLayout coordinatorLayout, V v, int i) {
        ˏ(coordinatorLayout, v, i);
        if (this.ˋ == null) {
            this.ˋ = new ard(v);
        }
        this.ˋ.ˏ();
        if (this.ॱ != 0) {
            this.ˋ.ˎ(this.ॱ);
            this.ॱ = 0;
        }
        if (this.ˎ != 0) {
            this.ˋ.ˏ(this.ˎ);
            this.ˎ = 0;
        }
        return true;
    }

    protected void ˏ(CoordinatorLayout coordinatorLayout, V v, int i) {
        coordinatorLayout.ˋ(v, i);
    }

    public boolean ˊ(int i) {
        if (this.ˋ != null) {
            return this.ˋ.ˎ(i);
        }
        this.ॱ = i;
        return false;
    }

    public int ॱ() {
        return this.ˋ != null ? this.ˋ.ˋ() : 0;
    }
}
